Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance 'kernel_upgrade' across supported OSes #14

Merged
merged 1 commit into from
Jun 19, 2013
Merged

Enhance 'kernel_upgrade' across supported OSes #14

merged 1 commit into from
Jun 19, 2013

Conversation

mckern
Copy link
Contributor

@mckern mckern commented Jun 19, 2013

kernel_upgrade currently searches for the driver "/lib/modules/${::kernelrelease}/kernel/drivers/scsi/vmw_pvscsi.ko", which isn't reliable on RHEL/CentOS 5. I've added some conditional logic to search for vmxnet3.ko instead, which appears to be universally installed regardless of distro (albeit in different locations across the different versions of RHEL/CentOS).

This has been tested across the CentOS flavors mentioned but it probably needs at least a little bit more tire kicking on Ubuntu. I didn't have any clients handy tonight, so please merge with a grain of salt.

kernel_upgrade currently searches for the driver
"/lib/modules/${::kernelrelease}/kernel/drivers/scsi/vmw_pvscsi.ko",
which isn't reliable on RHEL/CentOS 5. I've added some conditional
logic to search for vmxnet3.ko instead, which appears to be
universally installed regardless of distro (albeit in different
locations across the different versions of RHEL/CentOS).
craigwatson added a commit that referenced this pull request Jun 19, 2013
Enhance 'kernel_upgrade' across supported OSes
@craigwatson craigwatson merged commit e907314 into craigwatson:master Jun 19, 2013
@mckern
Copy link
Contributor Author

mckern commented Jun 20, 2013

So… I glubbed up.

Yuck. This turned into an annoyance.

  1. your cleanup is way better than my original code. Thanks for that.
  2. We both did this for what looks like (functionally) no reason at all.

As per your comment in #9 I checked which modules are part of the kernel by default across these four distros (Ubuntu 12.04 & 12.10, and CentOS 5/6) and vmxnet3.ko is indeed now part of the standard distribution for three of them (both Ubuntu releases and CentOS 6). So that's an unreliable test. But after uninstalling all VMware tools versions from an instance of each distro, I determined that 'vmci.ko' really does seem to be the missing link. I then manually ran vmware-install.pl -d (which in turn calls vmware-config-tools.pl -d) to install VMware tools across the instance of all 4 distros.

What I came up with is a bunch of numbers!

TL;DR

Does vmci.ko exist when VMware tools are installed?

VMware Tools version Ubuntu 12.04 Ubuntu 12.10 CentOS 5.9 CentOS 6.4
9.0.0-782409
9.0.1-913578
9.0.5-1065307

Data from each instance

CentOS 5, x86_64

[root@webinf-centos5-puppetclient ~]# lsb_release -rcs
5.9 Final
[root@webinf-centos5-puppetclient ~]# uname --hardware-platform
x86_64
[root@webinf-centos5-puppetclient ~]# vmware-toolbox-cmd -v
9.0.0.15210 (build-782409)
[root@webinf-centos5-puppetclient ~]# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/2.6.18-348.6.1.el5/misc/vmci.ko

------

[root@webinf-centos5-puppetclient ~]# lsb_release -rcs
5.9 Final
[root@webinf-centos5-puppetclient ~]# uname --hardware-platform
x86_64
[root@webinf-centos5-puppetclient ~]# vmware-toolbox-cmd -v
9.0.1.18551 (build-913578)
[root@webinf-centos5-puppetclient ~]# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/2.6.18-348.6.1.el5/misc/vmci.ko

------

[root@webinf-centos5-puppetclient ~]# lsb_release -rcs
5.9 Final
[root@webinf-centos5-puppetclient ~]# uname --hardware-platform
x86_64
[root@webinf-centos5-puppetclient ~]# vmware-toolbox-cmd -v
9.0.5.21789 (build-1065307)
[root@webinf-centos5-puppetclient ~]# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/2.6.18-348.6.1.el5/misc/vmci.ko

CentOS 6, x86_64

[root@webinf-centos6-puppetclient ~]# lsb_release -rcs
6.4 Final
[root@webinf-centos6-puppetclient ~]# uname --hardware-platform
x86_64
[root@webinf-centos6-puppetclient ~]# vmware-toolbox-cmd -v
9.0.0.15210 (build-782409)
[root@webinf-centos6-puppetclient ~]# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/2.6.32-358.11.1.el6.x86_64/misc/vmci.ko

------

[root@webinf-centos6-puppetclient ~]# lsb_release -rcs
6.4 Final
[root@webinf-centos6-puppetclient ~]# uname --hardware-platform
x86_64
[root@webinf-centos6-puppetclient ~]# vmware-toolbox-cmd -v
9.0.1.18551 (build-913578)
[root@webinf-centos6-puppetclient ~]# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/2.6.32-358.11.1.el6.x86_64/misc/vmci.ko

------

[root@webinf-centos6-puppetclient ~]# lsb_release -rcs
6.4 Final
[root@webinf-centos6-puppetclient ~]# uname --hardware-platform
x86_64
[root@webinf-centos6-puppetclient ~]# vmware-toolbox-cmd -v
9.0.5.21789 (build-1065307)
[root@webinf-centos6-puppetclient ~]# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/2.6.32-358.11.1.el6.x86_64/misc/vmci.ko

Ubuntu 12.04, x86_64

root@webinf-ubuntu1204-puppetclient:~# lsb_release -rcs
12.04
precise
root@webinf-ubuntu1204-puppetclient:~# uname --hardware-platform
x86_64
root@webinf-ubuntu1204-puppetclient:~# vmware-toolbox-cmd -v
9.0.0.15210 (build-782409)
root@webinf-ubuntu1204-puppetclient:~# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/3.2.0-48-generic/misc/vmci.ko

------

root@webinf-ubuntu1204-puppetclient:~# lsb_release -rcs
12.04
precise
root@webinf-ubuntu1204-puppetclient:~# uname --hardware-platform
x86_64
root@webinf-ubuntu1204-puppetclient:~# vmware-toolbox-cmd -v
9.0.1.18551 (build-913578)
root@webinf-ubuntu1204-puppetclient:~# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/3.2.0-48-generic/misc/vmci.ko

------

root@webinf-ubuntu1204-puppetclient:~# lsb_release -rcs
12.04
precise
root@webinf-ubuntu1204-puppetclient:~# uname --hardware-platform
x86_64
root@webinf-ubuntu1204-puppetclient:~# vmware-toolbox-cmd -v
9.0.5.21789 (build-1065307)
root@webinf-ubuntu1204-puppetclient:~# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/3.2.0-48-generic/misc/vmci.ko

Ubuntu 12.10, x86_64

root@webinf-ubuntu1210-puppetclient:~# lsb_release -rcs
12.10
quantal
root@webinf-ubuntu1210-puppetclient:~# uname --hardware-platform
x86_64
root@webinf-ubuntu1210-puppetclient:~# vmware-toolbox-cmd -v
9.0.0.15210 (build-782409)
root@webinf-ubuntu1210-puppetclient:~# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/3.5.0-17-generic/misc/vmci.ko

------

root@webinf-ubuntu1210-puppetclient:~# lsb_release -rcs
12.10
quantal
root@webinf-ubuntu1210-puppetclient:~# uname --hardware-platform
x86_64
root@webinf-ubuntu1210-puppetclient:~# vmware-toolbox-cmd -v
9.0.1.18551 (build-913578)
root@webinf-ubuntu1210-puppetclient:~# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/3.5.0-17-generic/misc/vmci.ko

------

root@webinf-ubuntu1210-puppetclient:~# lsb_release -rcs
12.10
quantal
root@webinf-ubuntu1210-puppetclient:~# uname --hardware-platform
x86_64
root@webinf-ubuntu1210-puppetclient:~# vmware-toolbox-cmd -v
9.0.5.21789 (build-1065307)
root@webinf-ubuntu1210-puppetclient:~# find /lib/modules/$(uname -r) -name "vmci.ko"
/lib/modules/3.5.0-17-generic/misc/vmci.ko

What does that have to do with anything?

  1. vmxnet3.ko is obviously not a good target for the check.
  2. There's no need for the selector in vmwaretools::params, because it looks like /lib/modules/${::kernelrelease}/misc/vmci.ko is pretty universal across the distros once VMware tools are installed (assuming their basic dependencies are met).
  3. vmw_pvscsi.ko, a previous target for the check, is also part of the base distribution on newer Ubuntu variants, so that's also an invalid target for the check. So at the very least, we (the collective we) were going to have to figure this out eventually.
  4. This is what happens when I throw code at a problem before I gather data. Due to the reports in Kernel_upgrade Exec[vmware_config_tools] runs every time on Ubuntu 12.04 LTS #9 and my own experiences with a constantly-running exec, I had assumed that there was something inherant to the way VMware tools are installed to each distro that prevented VMware tools from building vmci.ko. And from there I assumed that this is what kept other users from finding a vmci.ko module when they went to look for one. In retrospect, I suspect that it's more a by-product of some overlooked missing package on the machines that don't have it. When in doubt, find /lib/modules/$(uname -r) -name "vmci.ko" (or some variant thereof) is pretty handy.

What would I do if this was my module?

I'd probably walk back some of the changes. I'd keep the vmwaretools::params definition for $vmwaretools::params::config_creates, but I'd remove the selector and make it a straightforward assignment:

$config_creates = "/lib/modules/${::kernelrelease}/misc/vmci.ko"

Then I'd maybe dig into any issues stating that this check was repeatedly running and try to work out why the system is out of order, not the check. I think the original idea ("does vmci.ko exist? If not, rerun the config to build the modules again") was sound.

@mckern mckern deleted the search_for_vmxnet_driver branch June 20, 2013 04:51
@craigwatson
Copy link
Owner

Hi Ryan,
Thanks a lot for the awesome write-up! I'll make sure to give you credit on the readme! :)

I'll revert back to the vmci.ko check as per your suggestion, there does seem to be some funny stuff going on - I'll see what I can do to investigate.

Thanks,
Craig

craigwatson added a commit that referenced this pull request Jun 20, 2013
@ghost ghost assigned craigwatson Jun 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants